package com.itheima.mapper;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface OrderSettingMapper {

    //根据预约时间判断该预约是否已存在
    Integer findCountByOrderDate(Date orderDate);

    //预约已存在，修改预约数量
    void updateNumberByOrderDate(Date orderDate);

    //新增一条预约数据
    void addOrderSetting(OrderSetting orderSetting);

    //获取预约数据
    List<OrderSetting> findOrderSettingByDate(@Param("beginDate") String beginDate,@Param("endDate") String endDate);

    //更新预约数量
    void updateOrderSettingData(@Param("dayInfo") String dayInfo, @Param("value") Integer value);

    //判断预约数是否已满
    int findReservationsByOrderData(@Param("orderDate") String orderDate);

    //将t_ordersetting表的预约数加一
    void updateReservationsByDate(@Param("orderDate") String orderDate);
}
